package unit7;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

public class t_news {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        String ur1 = "jdbc:mysql://localhost:3306/1613580010";
        String name = "root";
        String password = "123";
        //注册驱动
        Class.forName("com.mysql.jdbc.Driver");
        //建立连接
        Connection con = DriverManager.getConnection(ur1, name, password);

        Statement stmt = con.createStatement();

        stmt.executeUpdate("inser into t_news values('时政','')");
        stmt.executeUpdate("inser into t_news values()");
        stmt.executeUpdate("inser into t_news values()");
        stmt.executeUpdate("inser into t_news values()");
        stmt.executeUpdate("inser into t_news values()");
        stmt.executeUpdate("inser into t_news values()");
    }
}
